package toDo.app.controllers;

import interfaces.ICentralManager;
import toDo.app.R;
import toDo.app.models.RequestCodes;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;

public class CentralManagerClickController implements OnClickListener{
	private ICentralManager activity;
	private Class<?> login;
	private Class<?> register;
	
	public CentralManagerClickController(ICentralManager activity, Class<?> login, Class<?> register){
		this.activity = activity;
		this.login = login;
		this.register = register;
	}
	
	public void setLoginTransition(Class<?> c){
		login = c;
	}
	
	public void setRegisterTransition(Class<?> c){
		register = c;
	}
	
	@Override
	public void onClick(View v) {
		switch(v.getId()){
			case R.id.mainLoginButton:			
				activity.startActivityForResult(new Intent(v.getContext(), login), RequestCodes.login);
				break;
			case R.id.mainRegisterButton:
				activity.startActivityForResult(new Intent(v.getContext(), register), RequestCodes.register);
				break;
		}	
	}
}
